<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>无标题文档</title>
		<LINK href="${pageContext.servletContext.contextPath }/css/style.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="${pageContext.servletContext.contextPath }/js/jquery.js"></script>
		<SCRIPT language=javascript type="text/javascript">
		function yicang(id) {
		  var zt = document.getElementById("content"+id).style.display;
		  if(zt =='none'){
			  document.getElementById("content"+id).style.display = 'block';
		  }else{
			  document.getElementById("content"+id).style.display = 'none';
		  }
		}
		</SCRIPT>
	</head>

	<body>
		<div class="left">
			<div class="admin">
            	<div class="admin-pic">
                </div>
                <div class="admin-text">用户名：${username }
               <br />
              	 <p>角色：${roles }</p>
                </div>
            </div>
            	<c:forEach items="${resources}" var="key" varStatus="stut">
				   <c:if test="${key.type eq 0}">
				       <c:if test="${stut.index eq 0}">
						<div  class="leftconon">
								<a href="#" id="toggle${stut.index}" onclick="yicang(${stut.index})" style="color:#FFFFFF;">
            				<div class="nav">
								<div class="navpic">
								<img src="${pageContext.servletContext.contextPath }${key.imgurl}" />
								</div>
								<div class="navtext2">${key.name}</div>
							</div>
								<div class="arrow">
				                	<img src="${pageContext.servletContext.contextPath }/images/arrrowdown.png" />
				                </div></a>
				          </div>
						  <div class="sidenav" id="content${stut.index}" style="display: none">
							 <c:forEach items="${resources}" var="k">
								<c:if test="${k.parentId eq key.id}">
					            	<div class="sidenavconf">
					                	<div class="side-left">
					                    </div>
					                    <div class="side-right">
					                    	<a href="${pageContext.servletContext.contextPath }${k.resUrl}" target="main"><img src="${pageContext.servletContext.contextPath }/images/sfwlbglA.png" style="vertical-align:middle;" />${k.name }</a>
					                    </div>
					                </div>
				                </c:if>
								</c:forEach>
				            </div>
						</c:if>
						<c:if test="${stut.index != 0}">
						<div  class="leftconoff">
								<a href="#" id="toggle${stut.index}" onclick="yicang(${stut.index})" style="color:#FFFFFF;">
            				<div class="nav">
								<div class="navpic">
									<img src="${pageContext.servletContext.contextPath }${key.imgurl}" /> 
								</div>
								<div class="navtext">${key.name}</div>
							</div>
							<div class="arrow">
				                	<img src="${pageContext.servletContext.contextPath }/images/arrrowdown.png" />
				                </div>
				                </a>
				             </div>
							 <div class="sidenav" id="content${stut.index}" style="display: none">
							 <c:forEach items="${resources}" var="k">
								<c:if test="${k.parentId eq key.id}">
					            	<div class="sidenavconf">
					                	<div class="side-left">
					                    </div>
					                    <div class="side-right">
					                    	<a href="${pageContext.servletContext.contextPath }${k.resUrl}" target="main"><img src="${pageContext.servletContext.contextPath }/images/sfwlbglA.png" style="vertical-align:middle;" />${k.name }</a>
					                    </div>
					                </div>
				                </c:if>
								</c:forEach>
				            </div>
						</c:if>
					</c:if>
				</c:forEach>
        </div>
	</body>
</html>
